package com.fmsz.xmly.activitys.myselfactivity.subsettingactivity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.fmsz.xmly.R;
import com.fmsz.xmly.utils.PhoneInfo;

import static com.fmsz.xmly.utils.PhoneInfo.getPath;
import static com.fmsz.xmly.utils.PhoneInfo.getSDPath;

public class CachePlaceActivity extends AppCompatActivity implements View.OnClickListener {

    private ImageView btn_back_place;

    private TextView ram_size_place;
    private TextView path1;
    private RelativeLayout place1;
    private ImageView argeement;

    private TextView ram_size_place2;
    private TextView path2;
    private ImageView argeement2;
    private RelativeLayout place2;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_cache_place);
        btn_back_place = (ImageView) findViewById(R.id.btn_back_place);
        btn_back_place.setOnClickListener(this);

        place1 = (RelativeLayout) findViewById(R.id.place1);
        place1.setOnClickListener(this);

        place2 = (RelativeLayout) findViewById(R.id.place2);
        place2.setOnClickListener(this);

        argeement = (ImageView) findViewById(R.id.argeement);
        argeement2 = (ImageView) findViewById(R.id.argeement2);

        ram_size_place = (TextView) findViewById(R.id.ram_size_place);
        ram_size_place.setText("可用" + PhoneInfo.getSDAvailableSize(this) + "G,共" + PhoneInfo.getSDTotalSize(this) + "G");

        ram_size_place2 = (TextView) findViewById(R.id.ram_size_place2);
        ram_size_place2.setText("可用" + PhoneInfo.getRomAvailableSize(this) + "G,共" + PhoneInfo.getRomTotalSize(this) + "G");

        path1 = (TextView) findViewById(R.id.path);
        path1.setText(PhoneInfo.getSDPath());

        path2 = (TextView) findViewById(R.id.path2);
        path2.setText(PhoneInfo.getPath());


    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_back_place:
                finish();
                break;
            case R.id.place1:
                argeement.setVisibility(View.VISIBLE);
                argeement2.setVisibility(View.INVISIBLE);
                break;
            case R.id.place2:
                argeement2.setVisibility(View.VISIBLE);
                argeement.setVisibility(View.INVISIBLE);
                break;

        }
    }





}
